/*
 * @Author: Wangtao
 * @Date: 2022-07-11 17:32:59
 * @LastEditors: Wangtao
 * @LastEditTime: 2022-08-25 12:37:54
 */
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

export const constantRoutes: Array<RouteRecordRaw> = [
  {
    path: '/404',
    name: '404',
    component: () => import(/* webpackChunkName: "adminLayout" */ '@app/base/views/layout/admin-layout/index.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "Login" */ '@app/base/views/login/index.vue')
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes: constantRoutes
})

export const resetRouter = () => {
  const newRouter = createRouter({
    history: createWebHistory(),
    routes: constantRoutes
  });
 (router as any).matcher = (newRouter as any).matcher // reset router
}

export default router
